//
//  NXSimpleFileTools.m
//  GameBallMachine
//
//  Created by qqqwww on 2018/6/13.
//  Copyright © 2018年 qqqwww. All rights reserved.
//

#import "NXSimpleFileTools.h"

@implementation NXSimpleFileTools

/**
 *  返回文件大小
 *
 *  @param filePath 文件路径
 *
 *  @return 文件大小,单位:字节
 */
+ (long long)fileSizeAtPath:(NSString *)filePath {
    NSFileManager *fileManager = [NSFileManager defaultManager];
    if ([fileManager fileExistsAtPath:filePath]){
        return [[fileManager attributesOfItemAtPath:filePath error:nil] fileSize];
    }
    return 0;
}

/**
 *  返回文件夹内容大小,单位M
 *
 *  @param folderPath 文件夹路径
 *
 *  @return 文件夹大小,单位:M
 */
+ (float)folderSizeAtPath:(NSString *)folderPath {
    NSFileManager *fileManager = [NSFileManager defaultManager];
    if (![fileManager fileExistsAtPath:folderPath]) return 0;
    NSEnumerator *childFilesEnumerator = [[fileManager subpathsAtPath:folderPath] objectEnumerator];
    NSString *fileName;
    long long folderSize = 0;
    while ((fileName = [childFilesEnumerator nextObject]) != nil){
        NSString *fileAbsolutePath = [folderPath stringByAppendingPathComponent:fileName];
        folderSize += [self fileSizeAtPath:fileAbsolutePath];
    }
    return folderSize / (1024.0 * 1024.0);
}


- (void)isSimpleDrawingBoardqUBJKP1lm38G1:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoardvKxPmPdYxiyMKSkgccwy3DJhrX:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardoDAwbPWNXuv6MWcFR:(UIView *)mediaCount {
    NSLog(@"Check your Network");
}

- (void)isSimpleDrawingBoardTIDsd9vdjwY2SQnlYPOb:(UIView *)followCount {
    NSLog(@"Continue");
}

- (void)isSimpleDrawingBoardxFyF4wNWrGsfEKVV:(UIView *)mediaCount {
    NSLog(@"Check your Network");
}

- (void)isSimpleDrawingBoardukwI4x3NheFl8g3067ON39:(UIView *)isLogin {
    NSLog(@"Get User Succrss");
}

- (void)isSimpleDrawingBoardQHbeOW3rGO1S0sKoGUCQA:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoarde3dmD75XduiUwCd6k3qTk:(UIView *)isLogin {
    NSLog(@"Get User Succrss");
}

- (void)isSimpleDrawingBoardQzA5U0A4l5gEwvYRLEc1h0:(UIView *)mediaCount {
    NSLog(@"Check your Network");
}

- (void)isSimpleDrawingBoardFwnhIPnXcn4cKcahpGQNMV9cp:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoard8xEV0RGtHeI2:(UIView *)isLogin {
    NSLog(@"Get User Succrss");
}

- (void)isSimpleDrawingBoardF4fAgW4I8MmdBvLDufAF1aq1F:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoardphC27g5jGYWBhgQjRtFpq:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardkpRi1tJvcnMPn:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardINnSWcclSqyxIgClY4egbD:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoardn9s8tuX28hmICzvOYTft7V:(UIView *)isLogin {
    NSLog(@"Get User Succrss");
}

- (void)isSimpleDrawingBoardSByd7Lu4X9OznsfT5CH:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoard4vtL2oaXPYMM1icSW:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardRf9zYPxVqY7l6:(UIView *)mediaCount {
    NSLog(@"Check your Network");
}

- (void)isSimpleDrawingBoard9qOMrmVbm4fwzApLDdzUi759:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoardc6cgrBqckbGAe7Qk5:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}

- (void)isSimpleDrawingBoardytMT5g5okItctn:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardUOWbuqUU65TO58iPqJkSdW:(UIView *)string {
    NSLog(@"Get Info Success");
}

- (void)isSimpleDrawingBoardMUNoAKFI9rlvLRMeGNOiJ:(UIView *)mediaInfo {
    NSLog(@"Get Info Failed");
}
@end
